﻿<Page
    x:Class="SpatialDataViewer.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:SpatialDataViewer"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:m="using:Bing.Maps">

    <Page.BottomAppBar>
        <AppBar>
            <AppBarButton Label="Import Data">
                <AppBarButton.Icon>
                    <FontIcon FontFamily="Segoe UI Symbol" Glyph="&#xE118;" />
                </AppBarButton.Icon>
                <AppBarButton.Flyout>
                    <MenuFlyout>
                        <MenuFlyoutItem Text="Well Known Text" Tapped="ImportData_Tapped" Tag="wkt"/>
                        <MenuFlyoutItem Text="Shapefile" Tapped="ImportData_Tapped" Tag="shp"/>
                        <MenuFlyoutItem Text="GeoRSS" Tapped="ImportData_Tapped" Tag="georss"/>
                        <MenuFlyoutItem Text="GPX" Tapped="ImportData_Tapped" Tag="gpx"/>
                        <MenuFlyoutItem Text="KML" Tapped="ImportData_Tapped" Tag="kml"/>
                        <MenuFlyoutItem Text="GeoJSON" Tapped="ImportData_Tapped" Tag="geojson"/>
                    </MenuFlyout>
                </AppBarButton.Flyout>
            </AppBarButton>
        </AppBar>
    </Page.BottomAppBar>

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <m:Map Name="MyMap" Credentials="YOUR_BING_MAPS_KEY">
            <m:Map.Children>
                <m:MapLayer Name="PinLayer"/>
                <m:MapLayer Name="InfoboxLayer" Visibility="Collapsed">
                    <Grid x:Name="Infobox" Width="350">
                        <Border Background="Black" Opacity="0.8" BorderBrush="White" 
                                BorderThickness="2" CornerRadius="5"/>

                        <Grid Margin="5">
                            <StackPanel HorizontalAlignment="Left" Margin="10">
                                <TextBlock Name="InfoboxTitle" FontSize="18" Width="290" 
                                           HorizontalAlignment="Left" TextWrapping="Wrap" />

                                <WebView Name="InfoboxDescription" Width="330" Height="100"
                                         Margin="0,10,0,0"/>
                            </StackPanel>

                            <Button Content="X" Tapped="CloseInfobox_Tapped" 
                                    HorizontalAlignment="Right" VerticalAlignment="Top"/>
                        </Grid>
                    </Grid>
                </m:MapLayer>
            </m:Map.Children>
        </m:Map>
    </Grid>
</Page>
